import React from 'react';
import { Form } from 'antd';
import Context from './context';

@Form.create()
class FormComponent extends React.PureComponent {
  // submit = () => {
  //   const { form } = this.props;
  //   console.log(form.getFieldsValue());
  // };

  render() {
    const { children, form } = this.props;
    return (
      <Context.Provider value={{ form }}>
        <div className="form">{children}</div>
        {/* <Button onClick={this.submit}>submit</Button> */}
      </Context.Provider>
    );
  }
}

export default {
  strategy() {
    return true;
  },
  component: FormComponent,
};
